<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>报修记录</title>
    <link rel="stylesheet" href="{{ asset('tool/layui/css/layui.css') }}">
    <script src="{{ asset('tool/js/jquery.min.js') }}"></script>
    <script src="{{ asset('tool/layui/layui.js') }}"></script>
</head>
<body>

<div class="layui-container">

    <div class="layui-tab">
        <div class="layui-tab-content">
            <div class="layui-btn-group" style="margin: 20px 0">
                <a type="button" class="layui-btn layui-btn-sm  layui-btn-normal" href="{{url('maintain-order')}}">返回</a>
            </div>
            @if(in_array($data->order_status,[1,2]) &&  $is_maintain_user)
            <div class="layui-btn-group">
                <a type="button" class="layui-btn layui-btn-sm layui-btn-warm" href="{{url('maintain-order-edit',$data->id)}}">
                    <i class="layui-icon">维修确认</i>
                </a>
            </div>
            @endif
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">报修时间</label>
                    <div class="layui-text">{{$data->created_at}}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">报修项目</label>
                    <div class="layui-text">{{$data->order_name}}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">报修场所</label>
                    <div class="layui-text">{{$data->maintain_site}}</div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">报修内容</label>
                    <div class="layui-text">{{$data->apply_content}}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">报修状态</label>
                    <div class="layui-text">{{\App\Models\MaintainOrder::ORDER_STATUS[$data->order_status]}}</div>
                </div>
                @if($data->order_status > 1)
                <div class="layui-form-item">
                    <label class="layui-form-label">配件更换</label>
                    <div class="layui-text">{{\App\Models\MaintainOrder::IS_REPLACE_MAINTAIN[$data->is_replace_maintain]}}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">维修费用</label>
                    <div class="layui-text"> <span> {{$data->maintain_money}} </span> <span>（元）</span></div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">配件费用</label>
                    <div class="layui-text"> <span> {{$data->mounting_money}} </span> <span>（元）</span></div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">总费用</label>
                    <div class="layui-text"><span> {{$data->sum_money}}</span> <span>（元）</span></div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">维修时间</label>
                    <div class="layui-text">{{$data->maintain_time}}</div>
                </div>
                @endif
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">报修图片</label>
                    @foreach($data->files as $file)
                        <img src="{{$file}}" width="80%"/>
                    @endforeach
                </div>
                @if($data->order_status > 1)
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">维修图片</label>
                    @foreach($data->maintain_images as $images)
                        <img src="{{$images}}" width="80%"/>
                    @endforeach
                </div>
                @endif
            </div>
        </div>
    </div>

</div>

<script>
    layui.use(['element','form','upload','layer'], function(){
        var element = layui.element;
        var layer = layui.layer
            ,form = layui.form;

    });
</script>

</body>
</html>
